package com.jnshu.service;


import com.jnshu.config.FeignMultipartSupportConfig;
import com.jnshu.tools.resultUtils.ResultBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
/**
 * @ClassName FileuploadClient
 * @Descrintion
 * @Author bd
 * @Date 2019/8/6 23:57
 * @Version 1.0
 **/
@FeignClient(url = "http://localhost:20822", value = "admin",configuration = FeignMultipartSupportConfig.class)
public interface FileuploadClient {

    /**
	 * 跨服务调用的方法,注意MultipartFile的注解要用@RequestPart
	 */

	@PostMapping(value = "/course/image", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultBean image(@RequestPart(value = "file") MultipartFile file);


}
